target remote :{{config.probe.openocd.port}}

{{#if reset}}
monitor reset halt
{{/if}}

{{#unless (lookup ports 0)}}
monitor itm port 0 off
{{/unless}}
{{#each ports}}
monitor itm port {{this}} on
{{/each}}

monitor tpiu config {{#if output}}internal {{output}}{{else}}external{{/if}} uart off {{config.log.swo.reset-freq}} {{config.log.swo.baud-rate}}

shell echo -n "1" > {{pipe}}
shell cat {{pipe}} > /dev/null
continue
monitor resume
